package cc.rengu.igas.channel.uprk.common.enums;

import org.omg.CORBA.UNKNOWN;

import java.util.Arrays;

/**
 * @author wukefan
 * @version 1.0.0
 * @date 2021/4/27 17:35
 */
public enum BankCardRiskEnum {
    SUSPECTED_FRAUD_APPLICANT("01", "欺诈嫌疑申领人"),
    SUSPICIOUS_MARKETERS("02", "可疑营销人员"),
    DENIED_TARNS_CARDHOLDER("03", "否认交易持卡人"),
    DENIED_CARDHOLDER("04", "否认办卡持卡人"),
    SUSPECTED_CASHOUT_CARDHOLDER("06", "疑似套现持卡人"),
    SUSPICIOUS_CARDHOLDER("11", "可疑行为持卡人"),
    ILLEGAL_FUND_ACCT_CARDHOLDER("13", "非法资金账户持卡人"),
    ILLEGAL_FUND_ACCT_BEHAVIOR_RECORD("14", "非法资金账户行为记录"),
    UNKNOWN("XX", "未知风险类型");
    private String key;
    private String value;

    BankCardRiskEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static BankCardRiskEnum getEnumValue(String key) {
        return Arrays.asList(BankCardRiskEnum.values()).stream().filter(bankCardRiskEnum -> bankCardRiskEnum.getKey().equals(key)).findFirst().orElse(BankCardRiskEnum.UNKNOWN);
    }

}
